<!DOCTYPE html>
<html>
	<head>
		{{include file="../common/head"}}
		<script type="text/javascript">
		$(function(){
			//初始化方法
			area.init('area');
			//修改的时候默认被选中效果
			area.selected('北京市','北京','朝阳区');
		})
	</script>
		<!--新增地址的  遮罩 -->
		<div id="zhezhao" style="display: none;"></div>
		<!--新增地址页面-->
		<div id="new_address" style="display: none;">
			<h3>收货地址</h3>
			<div class="address_in">
				<div class="c_form_con">
	                <label>收货人姓名：</label>
	                <div class="c_form_right">
	                    <input class="c_khname" placeholder="请输入真实姓名" maxlength="20" type="text">
	                    <p class="c_error">请输入真实姓名</p>
	                </div>
	                <div class="c_clear"></div>
	            </div>
	            <div class="c_form_con">
	                <label>收货人地区：</label>
            			<div id="areaAll">
            				<select style="height: 36px;" name="" id="area1">
									
							</select>
							<select style="height: 36px;" name="" id="area2">
			
							</select>
							<select style="height: 36px;" name="" id="area3">
			
							</select>
            			</div>
	                <div class="c_clear"></div>
	            </div>
				<div class="c_form_con">
	                <label>收货人地址：</label>
	                <div class="c_form_right">
	                	<div style="display: none;" class="c_address_infor" id="addStr"></div>
	                    <input class="c_details_address" placeholder="请输入正确收货人地址" type="text">
	                    <!--<p class="c_error">请输入正确收货人地址</p>-->
	                </div>
	                <div class="c_clear"></div>
	            </div>
				<div class="c_form_con">
	                <label>收货人手机：</label>
	                <div class="c_form_right">
	                    <input class="c_details_contact" placeholder="请输入收货人手机号" maxlength="11" type="text">
	                    <!--<p class="c_error" id="errorMobileMsg">请输入收货人手机号</p>-->
	                    <span style="color:#555;font-size:14px;margin-left:20px;">（注：此手机号可作为话费卡充值号码）</span>
	                </div>
	                <div class="c_clear"></div>
	            </div>
				<div class="c_form_con">
	                <label>支付宝账号：</label>
	                <div class="c_form_right">
	                    <input class="c_details_contact" id="zfbAccount" placeholder="支付宝账号" maxlength="30" type="text">
	                    <!--<p class="c_error" id="zfbAccountP">输入不合法</p>-->
	                    <span style="color:#555;font-size:14px;margin-left:20px;">（注：此支付宝账号可作为话费卡、加油卡充值账户）</span>
	                </div>
	                <div class="c_clear"></div>
	            </div>
				<div class="c_form_con">
	                <label>支付宝真实姓名：</label>
	                <div class="c_form_right">
	                    <input class="c_details_contact" id="zfbName" placeholder="支付宝真实姓名" maxlength="30" type="text">
	                    <!--<p class="c_error" id="zfbNameP">输入不合法</p>-->
	                </div>
	                <div class="c_clear"></div>
	            </div>							
				<div class="c_form_con">
	                <label>验&nbsp;&nbsp;&nbsp;&nbsp;证&nbsp;&nbsp;&nbsp;码：</label>
	                <div class="c_form_right">
	                    <input class="c_test" placeholder="请输入认证手机验证码" maxlength="6" type="text">
	                    <!--<p class="c_error">请输入认证手机验证码</p>-->
	                    <span class="c_veri_code">获取短信验证码</span>
	                    <!--<b class="c_add_tips">验证码发送至：<span>15400020001</span>请查收</b>-->
	                </div>
	                <div class="c_clear"></div>
                </div>							
				<div class="c_form_con" id="isdefaultDiv">
					<div class="c_new_form_right">
						<input id="isdefault" type="checkbox">
						<i>设为默认地址</i>
					</div>
				</div>
				<div class="c_form_con">
	                <button onclick="saveAddress();" class="c_save">保存</button><button class="c_save_other">取消</button>
	            </div>							
			</div>
			<span class="close_button"></span>
		</div>
		
		
		
		<!--个人中心部分开始-->
		<div id="myCenter_header">
			<div class="myCenter_header_box">
				<div class="investor_img">
					<a href="">
						<img src="./Public/Home/images/myCenter/11092564_avatar_big.jpg" alt="" />
					</a>
				</div>
							<!--investor投资者   details详细资料-->
				<div class="c_investor_details">
					<p><span id="timeMark">早上好</span>, <a href="">{{$_SESSION['uname']}}&nbsp;</a><span>拥抱积极的心态，改变现有的生活。</span></p>
					<ul class="c_investor_ul">
						<li>ID：<span id="ID">{{$_SESSION['userid']}}</span><i>|</i></li>              
						<li>手机：<span id="mobile">13400338878</span><!-- <a href="/member_new/save.do?flag=2">修改</a>--><i>|</i> </li>  
						<li class="investor_email">邮箱：<span id="email">未绑定</span><a id="updateEmailA" href="">绑定</a><i>|</i></li>    
						<li>昵称：<input id="updateNickName" value="" maxlength="15" style="display: none;" type="text"><a href="" style="color:#fff;" id="nicknamemsg">Vicky</a><i>|</i></li>   
						<li>会员等级：<span id="rankName">幼儿园</span></li>    
					</ul>
				</div>
				<div class="c_headercon_right">
					<a title="已经连续签到3天" href="" class="c_personage_data">
						<span id="signLogo" title="已经连续签到3天">已签到</span>
						<input id="signTime" type="hidden">
						<input id="mid" type="hidden">
					</a>
					<a href="" class="c_login_code">
						<span>登录密码</span>
					</a>
					<a href="" class="c_real_name">
						<span>收货地址</span>
					</a>
					<!--  <a href="/member_new/save.do" class="c_deal_code">
						<span>实名认证</span>
					</a>-->
				</div>
			</div>
		</div>
				<!--会员资料-->
				<div id="content_box">
					<!--left-->
					<div class="c_left_side">
						<ul class="c_left_nav">
							<li>
								<a class="c_first_out_a c_click_li" href="{{U('center/index')}}"><i></i>我的账户</a>
							</li>
							<li>
								<a class="c_out_a" href="{{U('center/record')}}"><i class="c_out_i_two"></i>夺宝记录</a>
							</li>
							<li>
								<a class="c_out_a" href="{{U('center/address')}}"><i class="c_out_i_three"></i>收货地址</a>
							</li>
							<li>
								<a class="c_out_a" href=""><i class="c_out_i_four"></i>安全中心</a>
							</li>
						</ul>
					</div>
					<!--right-->
					<div class="c_right_main">
						<div class="c_address_list">
							{{foreach from="$addressData" value="$v"}}
							<div class="c_address_detail c_new_address_detail">
								<p class="c_p_bg"></p>
								<div class="c_address_operation">
									<!--<div class="c_address_default"><i></i>默认地址</div>-->
									<div class="c_address_all_operation">
										<a href="javascript:;" title="删除" class="c_set_edit"></a>
									</div>
									<div class="c_user_address">
										<p class="c_user_message">{{$v['real_name']}}      {{$v['phone_num']}}</p>
										<p title="北京市   市辖区  朝阳区">{{$v['address']}}</p>
									</div>
									<span></span>
								</div>
								<input type="hidden" name="addid" class="addid" value="{{$v['addid']}}" />
							</div>
							
							{{endforeach}}
							<div class="c_add_address c_new_address_detail">
								<a href="javascript:;" class="c_add_address_btn"><i></i>增加新地址</a>
							</div>
						</div>
					</div>
				</div>
			<script type="text/javascript">
				$(function(){
					$(".c_set_edit").click(function(){
						//点击删除获得父级的父级的父级的序列号
						var n = $(this).parent().parent().parent().index(".c_address_detail");
						
						var addid = $(".addid").eq(n).val();
//						alert(addid)
						$.ajax({
							type:"post",
							url:"index.php?m=home&c=center&a=delAddress",
							data:{addid:addid},
							dataType:'json',
							success:function(data){
								if(data == 1){
									//remove()从DOM中删除所有匹配的元素。
									//才能实现点击删除消失
									$(".c_address_detail").eq(n).remove();
								}
							}
						});
					})
				})
			</script>
		<!--个人中心部分结束-->
		
		<!--最底部部分开始-->
		<div id="footer_in_box">山西云购电子商务有限公司 晋ICP备15005633号-1</div>
	</body>
</html>
